/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

import React from 'react';
import { Input, Icon } from 'antd';
import styles from './index.less';

const map = {
  UserName: {
    component: Input,
    props: {
      size: 'large',
      prefix: <Icon type="user" className={styles.prefixIcon} />,
      placeholder: 'admin',
    },
    rules: [
      {
        required: true,
        message: 'Please enter username!',
      },
    ],
  },
  Password: {
    component: Input,
    props: {
      size: 'large',
      type: 'password',
      placeholder: '密码',
    },
    rules: [
      {
        required: true,
        message: '请输入密码',
      },
    ],
  },
  Mobile: {
    component: Input,
    props: {
      size: 'large',
      placeholder: '11位手机号',
    },
    rules: [
      {
        required: true,
        message: '请输入手机号',
      },
      {
        pattern: /^1\d{10}$/,
        message: '手机号格式错误',
      },
    ],
  },
  Captcha: {
    component: Input,
    props: {
      size: 'large',
      placeholder: '验证码',
    },
    rules: [
      {
        required: true,
        message: '请输入验证码',
      },
    ],
  },
  PicCaptcha: {
    component: Input,
    props: {
      size: 'large',
      placeholder: '图形验证码',
    },
    rules: [
      {
        required: true,
        message: '请输入图形验证码',
      },
    ],
  },
};

export default map;
